using System;
using System.Collections.Generic;
using System.Text;
using NUnit.Framework;
using Ordering.Domain.TestUtil;

namespace Ordering.Domain.Tests
{
    [TestFixture]
    public class ProductTypeTests
    {
        #region Tests

        [Test]
        public void CanCreate()
        {
            ProductType productType = new ProductType(ProductCommonTestValues.ProductName, ProductCommonTestValues.ProductDescription,
                                                      ProductCommonTestValues.ProductIdentifier);

            Assert.AreEqual(ProductCommonTestValues.ProductName, productType.Name);
            Assert.AreEqual(ProductCommonTestValues.ProductDescription, productType.Description);
            Assert.AreEqual(ProductCommonTestValues.ProductIdentifier, productType.Identifier);
        } 

        #endregion

        #region Tests - Expected Exceptions

        [Test]
        [ExpectedException(typeof(ArgumentNullException))]
        public void MustProvideName()
        {
            new ProductType(null, ProductCommonTestValues.ProductDescription, ProductCommonTestValues.ProductIdentifier);
        }

        [Test]
        [ExpectedException(typeof(ArgumentNullException))]
        public void MustProvideDescription()
        {
            new ProductType(ProductCommonTestValues.ProductName, null, ProductCommonTestValues.ProductIdentifier);
        }

        [Test]
        [ExpectedException(typeof(ArgumentNullException))]
        public void MustProvideIdentifier()
        {
            new ProductType(ProductCommonTestValues.ProductName, ProductCommonTestValues.ProductDescription, null);
        }

        #endregion
    }
}
